 
  var storeout;
  function updataOnlineUser(msg)
  {
      storeout.reload({params:{start:0, limit:1000}});
  }
Ext.onReady(function(){
var ismodify=false;
	   Ext.QuickTips.init();
 	   /////////////grid
	var sm=new Ext.grid.CheckboxSelectionModel({
	singleSelect:false
 	});   
	var colml=new Ext.grid.ColumnModel([
	        new Ext.grid.RowNumberer(),
	        sm,
		    {id:'id',header: "ID", width: 40, sortable: true, dataIndex: 'id',hidden:true},
		    {header: "SessionId", width: 20, sortable: true,  dataIndex: 'sessionid'},
            {header: "登录账号", width: 20, sortable: true,  dataIndex: 'userId'},
            {header: "用户名", width: 20, sortable: true, dataIndex: 'userName'},
            {header: "登录终端IP", width: 20, sortable: true, dataIndex: 'loginhost'},
            {header: "登录时间", width: 20, sortable: true, dataIndex: 'logintime'} 
            ]
    );
    var store=new Ext.data.JsonStore({
    	root: 'data',
    	totalProperty: 'totalCount',
    	pruneModifiedRecords:true,//设置为true,则每次当store装载或有record被移除时,清空所有修改了的record信息. 默认为false. 
  		fields: [ 'id','userId','userName','loginhost','logintime','sessionid'],
		url: fullpath+'/sendisystem/onlineUserinit.do' ,
		remoteSort:true
    });
 
    storeout=store;
   
 
    var theadbar=new Ext.Toolbar({
     scope:this,height:25,items:[
		'-',{
            text: '踢除用户',
                 pressed: true,
            handler:function()
            {
                    var _sm=grid.selModel;
					if(_sm.getCount()==0)
					{
					    Ext.Msg.alert('信息','请选择需要踢除的用户');
					    return;
					}
				    var selec_record=_sm.getSelections();
				    var len=selec_record.length;
				    var id="";
				    for(var leni=0;leni<len;leni++)
				    {
				    	
				    	if(leni==len-1)
				    	{
				    		id+=selec_record[leni].get("sessionid");
				    	}
				    	else
				    	{
				    	 id+=selec_record[leni].get("sessionid")+",";
				    	}
				    }
			  
					Ext.Ajax.request({
				    url:fullpath+'/sendisystem/forcelogout.do',
				    success:function(_response,_options){
				        Ext.Msg.alert('信息','成功');
				   //    store.load({params:{start:0, limit:25}});
 					},
				   failure: function()
				   {
				    Ext.Msg.alert('信息','失败');
				   },
				   params: {forceuid: id }
				});
					
            }
        },'-',{
         text:'刷新',
           pressed: true,
            handler:function()
            {
                storeout.reload({params:{start:0, limit:1000}});
            }
        	
        }]
    
    	
    });
        ////
    var grid=new Ext.grid.GridPanel({
    	 region:'center',
    //	renderTo:"grid",
      //  height:500,
        title:'在线用户管理',
        store: store,
        cm:colml,
     	sm:sm,
        trackMouseOver:false,
        disableSelection:true,
        loadMask: {msg:'正加载数据...'},
        viewConfig: {
            forceFit:true            
        },
      
        tbar:theadbar
        
    });
	 var viewport = new Ext.Viewport({   //视图
           layout:'border',
           items:[grid]
        });   
	 grid.render();
	 store.load({params:{start:0, limit:1000}});
	  
})